<!DOCTYPE html>
<html lang="en">
<head>
[#include "/customer/include/static.htm"]
    <link href="${path}/resources/css/findpassword.css" rel="stylesheet"
          type="text/css" />
    <script type=text/javascript src="${path}/resources/js/jquery.md5.js"></script>

    <link href="${path}/resources/plug/layui/css/layui.css" rel="stylesheet" type="text/css"/>
    <script src="${path}/resources/plug/layui/layui.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function() {
            $("#code").click(function (){
                $.ajax( {
                    type:"post",
                    url:"${path}/front/common/getCode",
                    data:{
                        "userName" : $("#userName").val(),
                        "type":"忘记交易密码"
                    },
                    dataType: "text",
                    success : function(res) {
                        var result = $.parseJSON(res);
                        layer.msg(result.message);
                        if (result.success) {
                            $("#code").attr("disabled",true).addClass("sel");
                            var s = 60;
                            $("#code").text(s + "秒");
                            var inter = setInterval(function(){
                                s--;
                                $("#code").text(s + "秒");
                                if(s <= 0){
                                    $("#code").removeAttr("disabled").removeClass("sel").text("获取验证码");
                                    clearInterval(inter);
                                }

                            },1000);
                        }
                    }
                });

            });

            layui.use('form', function(){
                var form = layui.form(), $=layui.jquery, layer = layui.layer;
                form.on('submit(MainForm)', function(data){

                    var index = layer.load();
                    ajax({
                        url:"${path}/member/ucenter/forgetPaypass",
                        data: data.field,
                        success: function(result){
                            $(".step1").css("display","none");
                            $(".step2").css("display","");
                            $("#i2").addClass("zcurrent");
                            $(".zline").css("width","0px");
                            layer.close(index);
                        },
                        complete:function(){
                            layer.close(index);
                        },error:function(){
                            layer.close(index);
                        }
                    });
                    return false;
                });
            });

        });
    </script>
</head>
<body>
<!--头部-->
[#include "/customer/include/header.ftl"]

<div class="zhmm">
    <div class="top">找回密码</div>
    <div class="state">
        <div class="line">
            <div class="zline" style="width:900px"></div>


            <div class="progress1 pcurrent">
                <div class="current yuan">
                    <div class="zcurrent zyuan">1</div>
                </div>
                <a>手机确定账户</a>
            </div>

            <div class="progress3">
                <div class="yuan">
                    <div class="zyuan" id="i2">2</div>
                </div>
                <a>成功设置密码</a>
            </div>
        </div>
    </div>
    <div class="content step1">
        <form class="layui-form">
            <div>
                <input type="hidden" id="userName" name="userName" value="${user.user_name}">
                <i>*</i> <a>新的交易密码:</a> <input id="pass1" name="pass1" type="password" value=""  lay-verify="required">
            </div>
            <div>
                <i>*</i> <a>确认交易密码:</a> <input id="pass2" name="pass2" type="password" lay-verify="required">

            </div>

            <div>
                <a>手机验证码:</a> <input id="mobilecode" name="mobilecode" type="text" value=""  lay-verify="required" style="margin-left:35px;width:80px">
				<span style="padding-top:20px;">
				<button id="code" class="" type="button" class="btns" role="button"
                        aria-disabled="false" tabindex="0" hidefocus="true"
                        aria-pressed="false">获取验证码</button>
				 </span>

            </div>



            <div class="row">
                <button lay-submit lay-filter="MainForm" class="layui-btn" style="width: 280px;margin-top:3px;">确认提交</button>
            </div>
        </form>
    </div>


    <div class="contentb step2"style="display:none">
        <h1>恭喜您成功重置了交易密码！</h1>
        <h2>下次不要密码忘记了，赶紧去首页看看理财基金吧！</h2>
        <div class="row">
            <a href="/">
                <button id="submit1" type="submit" role="button"
                        aria-disabled="false" tabindex="0" hidefocus="true"
                        aria-pressed="false" style="cursor: pointer">返回首页</button>
            </a>
        </div>
    </div>
</div>
[#include "/customer/include/footer.ftl"]

</body>
</html>